<!--
 * @Author: zjj
 * @Date: 2019-11-26 13:22:55
 * @LastEditors: zjj
 * @LastEditTime: 2019-11-26 13:49:04
 -->
<!--  -->
<template>
  <div class="mask" @click="$emit('closeAds')" v-if="shareFlag">
    <div class="content" @click.stop>
      <div class="title">【获取0元抢购机会】</div>
      <div class="share flex aligin-center justify-between">
        <span>邀请新用户注册 +10</span>
        <span
          class="share-btn flex justify-center aligin-center f-14 f-bold"
          @click="$emit('shareActivity')"
        >立即邀请</span>
      </div>
      <div class="login flex aligin-center justify-between">
        <span>每日登录 +{{info.f_login.c}}</span>
        <span class="flex f-14" :class="info.f_login.s?'color-red':''">{{info.f_login.s?'已完成':'未完成'}}</span>
      </div>
      <div class="login flex aligin-center justify-between">
        <span>今日首次下单（非0元购）+{{info.f_o.c}}</span>
        <span class="flex f-14" :class="info.f_o.s?'color-red':''">{{info.f_o.s?'已完成':'未完成'}}</span>
      </div>
      <div class="login flex aligin-center justify-between">
        <span>当日下单金额满100元 +{{info.o_c.c}}</span>
        <span class="flex f-14" :class="info.o_c.s?'color-red':''">{{info.o_c.s?'已完成':'未完成'}}</span>
      </div>
      <div class="login flex aligin-center justify-between">
        <span>参与半价抢购获得大量机会</span>
         <router-link tag="span" :to="{name:'discount'}"
          class="share-btn flex justify-center aligin-center f-14 f-bold"
        >立即参与</router-link>
      </div>
      <span class="close-icon" @click="$emit('closeAds')"></span>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    shareFlag: {
      type: Boolean,
      default: () => {
        return false
      }
    },
    info:{
      type:Object,
      default:()=>{
        return {}
      }
    }
  },
  data() {
    return {}
  },
  computed: {},
  watch: {},
  methods: {},
  created() {},
  mounted() {},
  updated() {}, //生命周期 - 更新之后
  destroyed() {} //生命周期 - 销毁完成
}
</script>
<style lang='less' scoped>
//@import url(); 引入公共css类
.mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  z-index: 998;
  &::before {
    content: '';
    display: inline-block;
    vertical-align: middle;
    height: 100%;
  }
}
.content {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  z-index: 998;
  width: 345px;
  height: 338px;
  border-radius: 10px;
  background: #fff;
  background-size: 100% 100%;
  animation: show 0.3s 1;
  box-shadow: 14px 25px 16px 7px rgba(0, 0, 0, 0.05);
  @keyframes show {
    0% {
      opacity: 0;
      transform: scale(1.5);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }
  .title {
    padding-top: 18px;
    text-align: center;
    font-size: 18px;
  }
}
.color-red{
  color: #ED3E58;
}
.close-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 18px;
  height: 18px;
  background: url('../assets/imgs/close-dialog@3x.png');
  background-size: 100% 100%;
}
.share {
  font-size: 14px;
  margin: 49px 48px 0 34px;
}
.login {
  font-size: 14px;
  margin: 27px 55px 0 34px;
}
.active {
  color: #ed3e58;
}
.un-active {
  color: #acacac;
}
.share-btn {
  font-size: 12px;
  color: #fff;
  width: 59px;
  height: 21px;
  background: linear-gradient(
    184deg,
    rgba(247, 88, 151, 1),
    rgba(232, 49, 59, 1)
  );
  border: 1px solid rgba(245, 79, 117, 1);
  border-radius: 11px;
}
</style>